<HTML><HEAD><TITLE>tent_set(?X, +TV)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(tentative)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>tent_set(?X, +TV)</H1>
Set X's tentative value to TV
<DL>
<DT><EM>X</EM></DT>
<DD>Any term, typically a variable
</DD>
<DT><EM>TV</EM></DT>
<DD>A (nonvar) term
</DD>
</DL>
<H2>Description</H2>

	Give a variable (or several variables within a term) a tentative value.
	A tentative value cannot be itself a variable.
	<UL>
	<LI>If X is a variable without tentative value, it will be given the
	tentative value TV. In addition, its violatedness count will be
	initialised to 0.</LI>
	<LI>If X already has a tentative value, its tentative value is
	changed to TV. (Note that this may trigger further computation!)
	The violatedness count remains unchanged.</LI>
	<LI>If X is already instantiated, TV must be a strict instance of X.
	Variables within X are given tentative values from the corresponding
	instantiated parts of TV.</LI>
	</UL>
    
<H3>Modes and Determinism</H3><UL>
<LI>tent_set(-, +) is det
<LI>tent_set(+, +) is semidet
</UL>
<H3>Fail Conditions</H3>
TV is not an instance of X
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) </EM>
<DD>TV is not sufficiently instantiated
</DL>
<H2>Examples</H2>
<PRE>
    ?- tent_set(X, 27).
    X = X{27 -&gt; 0}
    Yes (0.00s cpu)

    ?- tent_set(X, 27), tent_set(X, 99).
    X = X{99 -&gt; 0}
    Yes (0.00s cpu)

    ?- tent_set(foo(X), foo(27)).
    X = X{27 -&gt; 0}
    Yes (0.00s cpu)

    ?- tent_set(X, Y).
    instantiation fault in X tent_set Y
    Abort
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/tentative/tent_get-2.html">tent_get / 2</A>, <A HREF="../../lib/tentative/has_tent_value-1.html">has_tent_value / 1</A>, <A HREF="../../lib/tentative/tent_fix-1.html">tent_fix / 1</A>
</BODY></HTML>
